<?php
/**
 * @title 1124. 表现良好的最长时间段 - 步长2+剪枝
 * @author start2004
 */

class Solution {

    /**
     * @param Integer[] $hours
     * @return Integer
     */
    function longestWPI($hours) {
        /**
         * @since 2020-10-27 长度
         */
        $len = count($hours);

        /**
         * @since 2020-10-27 初始化
         */
        if($hours[0] > 8){
            $tire = 1;
        } else {
            $tire = -1;
        }

        /**
         * @since 2020-10-27 归并
         */
        $count = 0;
        $counts = [];
        $flags = [];
        for($i=0; $i<$len; $i++){
            if($hours[$i] > 8){
                $t = 1;
            } else {
                $t = -1;
            }

            /**
             * @since 2020-10-27 统计数量
             */
            if($tire == $t){
                $count++;
            } else {
                $f = $tire*$count;
                $flags[] = $f;
                $counts[] = abs($f);

                /**
                 * @since 2020-10-27 新的状态
                 */
                $tire = $t;
                $count = 1;
            }
        }

        /**
         * @since 2020-10-27 收官
         */
        $f = $tire*$count;
        $flags[] = $f;
        $counts[] = abs($f);

        /**
         * @since 2020-10-29 整体状态位总和
         */
        $sumf = array_sum($flags);
        // return [$sumf, $flags, $len, $counts];

        /**
         * @since 2020-10-27 最长有效天数
         */
        $max = $maxf = 0;
        $s = $e = null;

        /**
         * @since 2020-10-29 长度
         */
        $l = count($counts);

        /**
         * @since 2020-10-29 长度只有1, 只有1个数, 看正负
         */
        if($l == 1){
            if($flags[0] > 0){
                return $flags[0];
            } else {
                return 0;
            }
        } elseif($l == 2) {
            /**
             * @since 2020-10-29 2个状态位
             * @since 2020-10-29 状态位之和 >=1, 全部
             */
            if($sumf >= 1){
                return $len;
            } else {
                /**
                 * @since 2020-10-29 正数数量小于等于负数, 正数数量*2-1
                 */
                if($flags[0] > 0){
                    return ($flags[0]<<1) -1;
                } else {
                    return ($flags[1]<<1) -1;
                }
            }
        } else {}

        /**
         * @since 2020-10-28 迭代起点和终点, 需要是正数
         */
        if($flags[0] > 0){
            $si = 0;
        } else {
            $si = 1;
            $sumf -= $flags[0];
            $len -= $counts[0];
        }
        if($flags[$l-1] > 0){
            $ei = $l-1;
        } else {
            $ei = $l-2;
            $sumf -= $flags[$l-1];
            $len -= $counts[$l-1];
        }

        /**
         * @since 2020-10-27 步长2的2次迭代
         */
        for($i=$si; $i<=$ei; $i=$i+2){
            $sf = $sumf;
            $cf = $len;

            /**
             * @since 2020-10-29 总数量都不大于max, break
             */
            if($cf <= $max){
                break;
            } else {}

            /**
             * @since 2020-10-29 1个数字比较, 避免迭代里判断是否越界
             */
            if($flags[$i] > $max){
                $max = $flags[$i];
                $maxf = $flags[$i];
                $s = $i;
                $e = $i;
            } else {}

            /**
             * @since 2020-10-29 尾部开始迭代
             */
            for($j=$ei; $j>=$i+2; $j=$j-2){
                /**
                 * @since 2020-10-29 总数量都不大于max, break
                 */
                if($cf <= $max){
                    break;
                } else {}

                /**
                 * @since 2020-10-29 优先匹配长, 便于剪枝
                 */
                if($sf > 0){
                    if($cf > $max){
                        $max = $cf;
                        $maxf = $sf;
                        $s = $i;
                        $e = $j;
                    } else {}
                    break;
                } else {
                    $sf = $sf - $flags[$j] - $flags[$j-1];
                    $cf = $cf - $counts[$j] - $counts[$j-1];
                }
            }

            /**
             * @since 2020-10-29 下次迭代, 状态和, 数目
             */
            if($i != $ei){
                $sumf = $sumf - $flags[$i] - $flags[$i+1];
                $len = $len - $counts[$i] - $counts[$i+1];
            } else {}
        }
        // return [$max, $maxf, $s, $e];

        /**
         * @since 2020-10-27 能否延长
         */
        if($maxf >= 2){
            /**
             * @since 2020-10-27 向前延生
             */
            if($s >= 1){
                $n = $counts[$s-1];

                if($maxf-$n >= 1){
                    $max += $n;
                    $maxf = $maxf-$n;
                } else {
                    $max += $maxf-1;
                    $maxf = 1;
                }
            } else {}

            /**
             * @since 2020-10-28 向后延生
             */
            if($maxf >=2 AND $e<=$l-2){
                $n = $counts[$e+1];

                if($maxf - $n >= 1){
                    $max += $n;
                } else {
                    $max += $maxf-1;
                }
            }
        } else {}

        /**
         * @return
         */
        return $max;
    }
}




/**
 * @url http://127.0.0.1/leetcode/202007/2020.07.28_8.php
 */
$datas = [
    // [9,9,6,0,6,6,9], // 3
    // [8,5,10,8,6,7,10,6], // 1
    // [12,8,7,7,9,10,8,7,9,7,8,11], // 5
    // [9,9,6,6,9], // 5
    // [9,9,6,6,9,9,6], // 7
    // [6,9,9,6], // 3
    // [6,9,9,9,6], // 5
    [7,9,10,10,6,7,9,10,7,10,7,10,12,7,7,10,7,7,9,8,10,10,10,6,6,8,12,6,8,8,11,12,11,12,11,8,6,6,9,10,12,6,9,11,9,7,11,11,10,10,12,11,6,7,6,9,11,10,8,12,10,6,7,6,7,8,6,6,10,6,12,10,9,7,12,7,11,10,11,9,11,6,8,11,12,12,10,6,8,8,8,6,8,6,6,12,8,8,6,8,9,8,7,10,9,12,8,11,9,9,10,11,7,12,8,6,6,7,11,12,10,9,11,8,11,9,8,11,9,9,6,9,11,9,6,6,12,6,12,11,8,10,8,10,12,9,11,11,10,9,10,7,8,9,11,10,10,7,9,9,8,12,6,8,6,12,7,9,11,7,10,11,8,7,9,7,6,10,6,9,9,7,12,10,7,8,6,9,6,10,6,6,9,12,8,12,9,11,9,7,8,6,8,6,6,12,6,7,12,12,10,9,8,9,10,8,8,12,9,12,11,12,7,10,8,8,8,12,12,11,7,10,8,12,10,6,8,9,9,7,10,10,10,8,10,9,11,7,6,7,9,12,10,7,10,9,12,8,7,10,10,9,6,9,11,11,6,6,7,7,12,10,7,11,11,7,8,6,9,7,11,7,7,9,7,12,10,7,6,11,12,11,12,8,10,11,11,9,12,9,6,12,7,12,9,8,11,9,8,12,8,8,8,10,9,6,8,8,7,8,11,9,7,11,8,9,9,9,9,9,10,10,8,6,6,6,11,9,9,6,6,9,8,7,6,12,10,7,8,11,7,11,7,7,11,11,11,11,10,7,8,10,7,8,11,6,10,10,9,10,8,9,12,10,12,8,7,9,10,10,8,11,11,10,7,12,12,11,9,8,9,12,8,12,10,9,10,8,9,10,8,12,11,9,6,8,6,9,10,6,8,12,11,7,8,6,6,6,11,12,10,6,10,12,12,6,12,12,12,11,7,7,6,10,6,9,8,10,8,10,8,10,8,9,6,9,10,11,11,12,10,7,9,10,10,12,12,11,8,7,12,7,10,12,12,12,6,8,7,6,8,9,9,8,8,8,9,8,12,8,8,10,12,8,6,10,6,8,8,8,8,11,8,9,10,7,9,11,8,11,8,10,10,9,6,11,6,11,8,9,10,7,10,8,10,7,8,6,12,8,8,8,6,6,8,12,10,6,10,12,6,10,10,7,12,10,11,8,9,11,8,10,9,10,9,11,10,10,8,6,11,7,8,8,12,9,8,10,7,7,6,6,11,6,9,12,8,8,11,6,7,8,7,11,8,10,9,10,6,12,9,6,6,11,10,7,6,6,9,10,12,11,8,12,6,7,8,9,11,7,6,6,9,7,10,11,12,8,6,12,12,9,12,8,8,10,8,7,12,11,12,12,7,10,6,10,10,9,8,7,11,10,8,7,12,10,12,9,10,7,12,7,7,8,8,10,11,8,11,7,8,10,10,12,10,9,6,12,7,6,12,8,6,7,12,11,12,8,6,11,11,7,12,12,9,7,11,10,9,12,7,6,6,8,11,11,8,8,8,6,7,11,10,10,12,12,9,9,9,11,8,9,9,6,8,8,8,10,9,8,8,9,12,7,9,6,8,8,9,10,8,7,11,10,9,9,11,10,12,9,8,6,10,7,10,10,7,8,9,9,6,10,6,9,9,12,9,10,9,7,9,7,12,6,12,7,9,12,6,6,7,6,8,8,12,12,6,12,12,10,6,10,9,7,7,11,11,12,7,8,9,7,7,11,9,9,9,11,8,10,6,12,11,9,6,9,8,9,7,11,10,9,6,11,8,10,12,7,10,8,12,6,12,8,12,12,11,12,10,9,11,8,12,12,8,6,7,9,12,6,8,6,8,11,12,9,12,8,8,6,12,11,9,7,6,11,7,12,12,11,10,6,7,11,10,6,10,7,10,10,10,7,12,7,12,12,8,8,11,9,9,9,12,6,9,8,11,6,9,11,6,11,7,6,10,7,8,11,10,10,12,8,10,11,8,7,10,9,12,9,12,11,8,7,11,6,7,12,12,9,10,9,8,11,9,9,8,8,12,7,7,7,7,8,10,11,7,11,12,8,12,6,10,6,10,9,9,6,10,8,10,11,11,7,6,11,10,6,6,7,12,6,9,8,7,7,9,9,6,12,6,7,8,7,10,12,11,10,6,8,9,9,12,11,7,10,11,9,9,7,9,10,9,11,7,11,8,9,10,7,6,10,9,10,10,12,8,8,10,6,7,9,6,6,9,12,6,8,12,8,12,6,6,12,6,7,6,10,11,6,11,9,8,8,11,10,9,12,7,7,11,7,10,8,7,12,7,7,6,7,10,9,12,11,10,9,6,11,8,8,10,6,10,9,8,6,12,7,7,12,11,8,10,11,7,6,11,10,12,8,12,8,9,11,7,6,6,7,10,8,8,10,9,10,12,11,8,12,10,12,7,9,12,7,9,8,6,7,8,9,11,8,12,7,7,12,12,11,10,8,9,6,11,8,7,8,8,12,11,12,11,10,11,8,8,7,9,10,8,12,12,6,6,8,7,10,12,12,7,12,6,7,6,12,10,12,7,6,9,8,9,12,10,11,7,8,6,6,11,12,9,8,11,10,7,12,7,11,11,7,9,10,9,11,12,12,10,10,10,11,7,9,8,10,6,8,10,10,12,12,7,8,7,6,6,9,7,6,6,7,9,8,9,6,12,11,8,9,10,8,10,6,12,6,7,11,6,7,10,12,7,6,7,10,12,12,12,10,11,8,12,9,7,7,8,7,6,7,6,8,6,7,10,7,7,11,12,10,9,8,9,9,9,7,10,6,9,7,11,7,10,8,12,10,9,7,10,11,8,11,11,12,12,9,12,10,6,12,10,7,7,6,9,9,8,12,6,12,11,7,11,8,9,10,11,8,10,12,12,11,6,11,9,7,12,7,9,10,12,9,10,10,8,7,8,6,6,10,11,8,10,11,11,10,12,12,6,10,10,12,6,10,11,12,11,12,12,12,11,7,12,11,9,8,11,6,9,7,10,11,7,12,11,7,8,8,12,6,11,8,6,8,6,6,11,11,12,8,9,11,12,10,12,6,8,11,11,11,10,10,12,8,12,6,7,6,7,8,9,9,8,7,7,7,7,8,6,7,11,8,9,7,9,6,11,8,6,12,7,8,8,12,6,12,8,12,12,6,6,10,8,7,11,12,7,11,7,12,6,10,12,10,9,6,7,9,12,9,9,10,7,8,7,6,9,6,10,10,12,7,10,12,6,7,12,7,11,6,7,7,6,8,10,10,8,12,8,8,6,10,7,9,12,9,10,7,11,9,9,6,10,8,6,7,9,11,10,10,12,9,6,11,7,11,6,9,6,10,10,9,8,9,8,12,6,12,7,10,10,6,11,11,8,11,11,9,11,6,10,7,6,11,8,11,8,9,9,12,8,9,9,7,9,8,7,10,12,6,6,10,11,7,9,9,7,12,10,8,6,6,7,10,9,9,11,9,10,6,11,10,8,10,9,9,8,12,9,7,11,9,10,6,7,7,10,6,10,11,11,8,6,11,9,7,10,9,12,11,12,12,12,8,11,9,8,8,9,12,7,8,10,12,11,12,6,9,7,9,6,6,7,7,12,8,11,9,9,10,9,8,7,9,9,8,7,10,8,12,8,6,11,6,12,12,6,11,12,11,11,10,11,12,6,11,12,8,9,9,8,10,11,10,7,8,8,6,8,9,6,8,12,9,10,11,10,6,6,11,8,6,8,8,7,10,7,6,7,12,6,6,11,8,10,12,10,12,7,11,6,10,12,6,9,10,8,10,10,9,10,9,8,11,6,8,9,9,6,8,12,8,9,6,9,12,7,12,8,6,6,9,9,8,6,8,11,12,9,7,11,12,11,8,6,9,9,8,6,12,7,11,12,12,7,11,10,12,11,12,7,6,7,9,8,6,6,9,11,7,12,10,7,8,11,6,7,8,10,9,12,11,8,8,10,9,9,12,10,6,11,9,6,8,8,9,8,6,11,7,6,8,11,11,6,6,11,8,10,7,10,9,7,11,9,6,10,6,9,9,9,11,10,10,7,6,8,10,10,8,11,12,7,10,8,10,9,9,6,10,9,6,9,10,12,7,10,9,10,7,10,6,8,8,7,7,8,11,7,10,11,12,7,7,11,10,6,8,10,8,10,6,12,7,7,11,7,12,11,6,10,7,11,7,8,10,12,12,10,11,10,12,9,9,12,11,10,11,11,6,9,12,8,6,11,10,10,10,11,11,12,12,12,8,11,12,11,11,6,12,12,9,6,8,12,6,7,6,10,9,9,8,12,11,7,12,8,8,11,6,9,7,10,8,11,8,9,7,8,8,9,7,7,10,10,7,7,7,10,9,12,11,10,6,10,7,6,6,10,7,9,7,9,12,7,7,9,9,10,9,10,9,7,9,7,11,12,9,6,6,12,11,10,8,12,9,10,7,6,10,11,11,11,10,10,12,10,6,11,9,9,9,8,10,11,7,11,10,11,8,10,12,10,11,10,9,7,12,11,9,6,12,6,10,6,11,11,7,7,7,12,7,7,8,6,7,9,10,7,11,6,11,7,7,12,8,9,9,12,8,12,10,11,11,11,7,12,9,12,9,7,11,12,12,6,8,12,8,9,9,6,11,7,7,7,7,7,9,9,11,10,6,10,6,6,6,9,12,6,8,9,6,12,7,10,12,7,6,10,9,7,10,10,12,7,10,8,7,11,9,7,11,6,8,9,9,8,11,12,7,8,12,10,9,7,11,11,6,12,10,7,10,11,8,10,11,7,8,12,10,8,12,12,12,12,9,7,9,8,8,8,7,12,7,12,12,12,12,9,12,6,9,9,11,11,10,6,11,8,11,12,6,12,8,12,12,10,12,10,8,6,9,6,10,8,7,7,6,7,11,12,8,10,10,12,10,8,7,7,8,12,11,9,11,8,8,11,9,6,9,9,9,12,7,12,9,11,10,10,7,7,8,9,11,10,10,12,9,8,7,11,6,10,12,12,8,6,7,8,7,12,12,12,7,9,10,10,8,11,7,9,7,12,8,8,8,10,6,11,9,7,6,9,8,11,9,11,7,7,8,7,11,7,11,11,11,6,10,10,10,9,9,8,8,10,6,7,10,12,6,12,6,10,11,9,8,7,6,8,6,11,8,10,12,6,6,8,12,6,10,11,12,6,11,10,6,11,10,8,9,9,6,11,12,11,7,11,7,12,12,7,6,9,6,12,8,10,11,7,6,12,12,8,7,6,9,11,11,8,8,7,12,11,10,10,6,11,12,8,12,9,10,6,12,11,10,10,8,10,9,11,6,9,12,11,11,12,9,9,11,11,9,8,11,8,8,12,7,10,9,11,7,8,10,11,6,9,11,6,9,6,10,12,8,6,6,6,11,12,6,11,7,9,6,8,7,6,7,7,12,10,12,7,6,11,7,10,6,9,9,7,8,7,11,9,11,9,12,8,12,10,9,6,6,7,6,12,12,10,11,8,9,8,11,10,10,7,10,8,6,10,8,11,9,7,6,8,6,12,7,8,11,8,10,9,12,12,7,11,12,11,7,8,12,11,8,6,12,12,10,11,9,6,8,9,6,6,7,6,9,11,10,11,7,6,8,10,8,7,7,8,7,11,12,10,9,11,10,12,8,8,9,10,9,9,8,9,10,9,9,7,8,8,8,7,6,8,9,10,10,6,11,9,11,11,10,10,7,7,12,6,8,11,9,9,11,7,7,6,6,6,8,9,7,9,11,12,6,7,8,9,12,12,8,8,9,10,8,6,6,9,7,12,6,10,12,10,6,8,9,12,9,9,11,9,8,8,12,7,10,8,10,11,10,6,9,8,9,12,6,9,6,9,12,9,8,11,6,7,11,12,10,12,6,6,7,9,6,9,9,12,7,12,6,8,12,9,6,7,10,12,12,7,9,10,9,12,10,8,9,12,7,11,7,7,7,9,11,6,11,11,12,7,10,10,9,11,7,12,7,8,6,11,12,7,8,9,7,8,7,8,7,12,12,12,11,8,11,11,7,9,9,8,9,9,6,10,8,10,6,10,8,8,9,8,11,10,6,7,11,12,6,9,10,6,8,8,11,7,6,11,7,9,11,6,10,7,8,7,10,12,10,7,7,11,8,10,7,9,11,9,6,11,12,9,11,8,9,12,12,8,8,9,10,10,12,8,6,10,12,7,11,10,9,9,9,10,9,12,7,7,9,11,11,7,7,10,10,6,7,6,8,6,11,11,9,6,10,12,11,7,6,10,12,7,8,11,9,7,10,6,8,10,11,12,6,9,9,8,9,11,6,8,11,7,11,10,10,6,12,12,12,10,8,12,7,10,9,12,11,7,8,6,10,9,8,9,6,11,7,6,9,11,9,9,8,6,7,12,7,12,7,9,9,7,6,7,10,6,10,9,6,11,7,6,7,10,9,7,12,10,12,6,7,8,12,9,11,10,10,12,9,8,7,12,8,8,11,7,7,12,7,11,6,10,10,11,7,7,6,12,11,12,12,11,12,10,10,11,7,12,12,9,8,6,8,11,7,11,12,10,8,7,8,6,11,10,10,11,12,10,12,7,12,6,9,9,8,7,12,8,10,7,10,10,9,9,8,9,6,7,11,7,9,11,6,11,11,8,9,10,9,7,12,11,7,6,10,11,7,8,6,7,11,12,11,8,12,6,10,11,11,10,8,7,12,12,9,9,12,12,11,11,7,9,9,10,10,9,12,11,7,10,10,11,10,6,9,11,7,9,11,6,9,10,12,9,12,9,8,6,6,7,6,9,7,11,11,11,9,10,9,8,9,6,12,6,11,11,12,11,7,9,7,10,9,10,7,10,10,7,9,6,11,11,9,12,6,9,12,9,11,12,10,6,9,12,11,12,6,9,11,9,9,9,9,10,9,8,12,8,8,9,9,6,8,11,8,7,7,10,8,12,12,8,12,9,8,7,7,12,7,6,8,11,11,10,9,6,12,6,7,11,12,12,8,10,8,10,12,8,12,6,8,11,10,8,9,10,12,10,9,9,11,12,8,10,11,6,9,6,11,9,8,10,9,12,9,6,12,9,12,9,10,12,7,6,7,6,12,10,11,12,9,8,8,8,8,6,7,7,6,12,7,7,9,12,6,6,6,12,10,10,7,6,10,12,8,6,7,11,8,11,10,6,12,11,6,10,11,7,8,8,12,6,11,6,8,6,6,12,10,10,6,6,6,11,11,12,8,11,12,6,7,11,12,8,10,11,6,12,11,11,9,8,9,10,11,7,10,6,8,12,8,8,7,10,9,9,9,8,7,10,12,7,9,6,9,8,8,10,12,8,6,9,7,7,10,7,10,9,12,12,8,7,7,7,8,10,7,6,12,10,11,12,12,11,11,10,10,8,7,11,12,10,8,11,6,7,11,8,9,8,9,9,6,10,12,11,6,7,11,7,10,9,11,10,6,6,9,9,8,12,7,9,10,7,12,10,10,8,8,6,8,10,12,11,7,7,12,7,11,11,8,11,9,8,11,8,8,10,6,10,10,12,10,11,9,6,6,8,6,11,6,9,10,10,7,9,6,12,12,7,8,9,12,8,8,10,11,11,8,8,7,12,7,7,12,9,10,8,8,8,7,7,6,12,9,9,8,7,10,11,8,6,9,12,9,9,7,9,7,6,12,8,12,12,7,9,7,10,11,12,10,10,12,8,11,12,8,11,10,12,7,10,10,10,6,12,7,6,7,7,12,8,7,11,9,10,8,7,8,9,11,8,10,11,7,7,6,7,11,6,9,10,11,12,8,8,11,7,7,7,8,7,8,7,10,6,6,12,7,10,7,8,11,8,12,8,12,6,6,11,11,7,7,8,6,7,9,8,8,7,6,6,7,12,9,6,7,7,6,8,12,6,12,9,10,6,8,9,8,11,8,11,7,12,11,10,9,12,10,8,6,12,11,11,11,6,10,8,7,12,7,10,6,11,7,9,8,8,7,11,7,11,9,6,11,11,10,7,8,12,9,9,7,7,10,8,12,7,11,8,9,7,11,8,12,7,9,7,11,6,8,12,9,12,6,7,10,6,6,7,11,11,10,6,12,10,7,12,11,9,11,7,11,12,6,7,9,9,10,10,12,9,6,12,11,8,11,8,7,11,11,9,12,10,7,7,11,9,8,7,8,6,10,11,9,8,12,11,7,11,11,11,6,10,12,12,6,6,10,7,12,11,12,7,10,6,7,9,12,11,8,12,11,11,12,8,8,9,7,7,11,9,6,12,9,6,8,11,12,7,10,9,8,12,12,7,11,7,7,12,7,9,6,11,10,6,8,7,9,7,6,12,8,9,12,11,11,8,9,7,8,6,8,9,7,8,9,9,7,11,11,11,7,11,7,11,11,12,6,9,8,8,12,11,11,11,7,6,6,11,9,7,8,6,8,10,9,9,10,8,6,12,12,7,8,11,9,9,10,10,8,7,9,7,10,12,11,9,8,7,9,10,10,6,12,8,7,12,11,10,11,12,7,6,8,12,12,11,9,8,10,10,10,7,12,7,10,9,10,9,8,8,12,9,8,7,8,7,6,10,12,7,10,10,6,12,6,7,7,7,8,12,8,6,6,6,7,12,9,8,11,10,11,11,6,12,9,10,11,8,9,11,9,9,11,12,7,8,12,10,12,8,6,12,12,11,7,6,9,7,7,9,6,12,8,8,11,11,9,12,9,8,8,9,6,11,9,8,12,10,10,12,6,9,7,10,9,8,11,8,12,9,7,10,8,8,12,9,11,12,9,10,12,7,10,8,10,7,9,6,8,9,8,9,9,9,10,10,9,9,7,8,11,8,9,12,9,11,12,8,7,11,11,7,9,9,7,10,9,6,9,10,12,10,10,6,7,12,8,10,11,11,9,6,7,12,7,9,10,9,6,10,9,9,12,8,6,8,12,7,8,8,8,9,10,12,12,8,11,10,8,10,10,7,6,11,9,12,11,9,12,10,6,11,7,8,11,11,8,8,9,8,7,11,10,8,7,6,9,12,9,10,8,12,11,12,7,6,9,12,7,11,10,10,7,12,7,6,12,11,6,7,7,10,8,11,9,11,7,12,6,12,7,10,12,12,11,10,10,6,8,11,11,7,8,8,11,10,12,8,10,6,9,9,10,9,11,6,11,7,9,7,7,6,9,8,7,6,6,10,11,11,12,6,7,9,11,10,11,8,11,7,9,7,11,6,9,9,12,10,9,10,11,10,12,9,8,6,7,8,10,8,10,11,6,9,10,6,6,9,6,8,11,6,8,9,9,8,9,8,8,10,11,6,12,6,10,12,12,12,8,12,6,7,6,7,12,8,10,12,12,9,11,12,8,11,9,11,8,6,7,6,6,8,8,10,6,6,8,10,9,11,9,7,10,12,7,9,11,11,12,9,6,6,10,7,11,11,11,7,10,11,11,8,7,7,7,10,7,12,10,10,9,12,9,9,9,10,9,7,7,12,8,7,9,11,7,9,8,9,6,6,11,10,7,9,10,12,6,6,11,9,12,7,9,12,12,11,12,12,11,10,11,10,12,11,7,7,9,6,7,11,8,6,11,11,9,6,12,11,9,8,12,11,7,6,8,12,6,10,12,11,9,8,8,11,11,10,11,12,9,8,7,7,10,10,8,12,10,12,11,8,8,9,6,10,12,6,10,6,9,10,6,11,7,9,12,7,6,10,6,9,12,12,10,12,8,10,9,12,9,7,9,7,9,11,6,9,9,6,7,8,9,10,7,7,7,7,9,9,6,7,6,11,6,8,12,9,10,11,8,6,9,6,6,10,8,6,10,11,11,9,6,12,7,8,12,8,11,12,12,9,12,7,7,11,11,7,10,8,10,11,8,7,11,7,12,8,8,9,9,9,8,7,8,8,10,10,9,8,8,6,7,11,11,6,7,8,6,6,8,6,8,12,7,12,9,9,8,8,11,11,12,7,7,6,12,7,12,11,11,10,10,10,6,7,8,12,12,7,8,12,11,6,10,7,9,7,9,10,11,8,9,10,12,7,7,6,6,9,10,8,9,6,11,11,10,7,10,12,12,11,7,11,6,7,11,7,11,8,10,7,7,7,12,12,12,8,6,7,11,6,11,7,10,12,7,6,6,9,6,9,10,8,6,8,10,12,8,11,11,9,9,8,8,8,9,12,9,9,7,10,8,7,10,11,12,12,10,11,8,8,9,6,7,6,8,9,11,11,9,8,10,11,7,6,8,12,11,9,6,6,6,9,9,11,9,7,8,11,7,7,12,8,7,7,8,12,9,10,7,10,11,12,12,7,10,10,10,7,7,9,9,7,6,10,6,8,7,12,7,9,9,9,11,12,11,7,8,8,12,10,8,8,9,10,8,11,8,12,12,9,6,6,8,10,7,7,6,6,9,6,9,6,9,12,11,6,6,12,6,7,11,7,9,9,9,11,9,9,8,11,11,10,11,10,11,9,12,12,11,7,9,11,9,7,11,6,10,7,9,9,6,8,12,8,10,6,12,9,8,9,12,12,9,11,10,7,12,8,12,6,11,7,12,10,9,7,7,10,12,10,10,7,12,11,9,8,9,6,7,10,11,11,10,8,12,7,12,9,9,6,8,9,9,11,12,7,9,9,8,11,12,12,6,10,8,10,9,10,8,12,12,10,8,12,12,11,11,7,7,12,10,12,7,10,10,10,11,7,11,6,11,9,12,9,8,8,10,6,9,8,10,7,12,11,6,6,6,12,11,9,6,6,10,12,9,6,9,10,9,7,8,9,7,6,11,9,6,12,8,11,6,11,6,8,11,7,9,6,7,12,12,11,8,10,8,8,8,8,11,11,12,6,6,9,6,7,9,9,11,8,12,11,8,9,9,7,10,8,12,7,11,10,10,8,9,8,12,12,7,7,8,8,9,7,6,7,8,10,12,9,8,8,9,12,9,10,9,12,7,12,11,8,11,8,11,7,6,7,10,6,10,11,8,6,10,10,9,11,9,10,12,10,12,12,7,6,6,10,6,7,10,6,8,6,10,10,9,10,7,9,9,9,7,6,7,7,11,11,12,9,9,6,11,11,6,11,12,12,8,12,7,9,7,6,6,6,8,10,6,8,8,10,10,7,9,9,8,9,12,10,12,11,10,6,6,11,8,9,10,6,8,6,11,12,7,8,12,10,6,7,8,10,11,12,11,8,12,6,8,7,10,11,10,8,8,12,7,9,11,9,7,6,9,12,12,8,7,9,12,6,7,8,6,6,7,10,10,11,8,11,6,10,6,11,11,7,6,9,8,8,11,12,6,10,6,8,10,12,6,8,8,11,12,11,6,11,11,12,7,10,6,7,11,12,10,12,8,7,11,7,10,11,10,11,10,7,8,7,9,8,11,11,6,9,7,6,8,6,9,11,10,10,7,10,9,7,6,6,7,7,6,12,6,7,9,12,6,12,12,7,10,12,10,12,11,10,6,9,12,12,12,11,6,10,6,9,9,11,8,6,9,7,7,8,11,9,11,8,12,8,12,12,11,11,12,11,12,11,9,8,9,6,10,11,8,6,7,6,9,12,12,8,12,12,11,7,6,8,6,9,6,10,12,12,6,7,9,10,8,11,12,7,7,8,8,8,11,7,7,8,10,12,6,8,10,7,10,10,8,10,9,7,8,12,11,7,9,11,6,10,11,12,11,7,10,6,9,10,8,6,8,7,12,8,7,12,7,9,12,6,11,9,7,9,8,6,11,12,9,11,6,11,11,8,12,8,12,9,11,7,10,10,12,10,12,9,10,9,12,8,10,9,12,6,8,12,9,7,9,11,11,12,7,11,8,6,6,6,9,11,10,11,10,11,10,8,7,7,11,9,10,6,6,11,7,9,11,8,12,11,12,11,11,12,11,8,12,7,6,10,8,6,6,12,8,9,6,11,6,6,10,6,11,12,7,7,9,10,12,8,9,9,11,12,7,11,6,6,7,12,9,11,9,9,8,10,8,7,12,10,12,8,7,10,10,6,10,7,9,6,11,10,12,12,10,6,11,10,11,11,8,6,8,12,9,9,10,8,10,11,11,9,11,7,12,10,7,7,6,8,10,10,10,11,10,7,9,6,10,8,7,9,6,11,12,10,9,6,11,12,10,11,8,12,7,7,10,8,11,7,8,7,9,10,11,10,12,10,6,6,11,8,6,8,11,12,7,11,8,7,8,7,9,8,11,11,6,8,10,12,9,7,6,10,9,6,9,8,8,11,7,7,12,11,10,11,6,12,12,7,12,6,12,9,6,11,11,7,7,12,11,7,8,6,11,10,7,10,9,10,9,12,7,8,10,11,11,12,12,7,7,6,7,11,9,7,9,7,12,6,10,9,10,10,11,10,9,12,6,6,12,7,12,12,9,8,12,10,12,6,8,12,7,12,7,10,6,9,11,9,9,8,7,12,11,6,9,8,11,7,9,10,11,9,7,6,10,7,6,8,6,10,9,7,10,7,9,9,6,12,12,7,9,11,7,12,8,11,11,8,6,10,8,12,6,6,12,11,11,7,7,8,10,12,6,6,7,6,7,9,9,7,8,11,8,8,12,8,12,11,7,11,8,9,12,10,12,8,11,10,10,6,10,11,12,6,7,6,12,9,8,11,11,8,7,11,6,9,6,12,11,7,7,12,11,6,9,12,11,6,9,12,12,10,8,11,10,6,11,9,11,7,8,12,9,11,7,12,9,6,9,6,11,8,6,9,7,6,6,11,10,6,10,6,7,12,9,10,6,6,12,9,11,6,11,10,12,8,10,7,6,10,9,12,12,6,10,10,9,11,12,9,12,9,6,7,10,10,10,8,9,12,10,12,10,9,10,11,10,9,10,8,8,11,9,9,8,10,12,12,6,9,9,10,7,7,6,10,6,10,8,9,8,6,6,11,10,7,6,11,8,6,7,11,9,10,7,11,9,7,10,10,9,9,10,12,10,12,8,10,11,9,8,9,12,10,8,11,11,12,8,11,9,10,6,9,10,8,8,10,12,9,8,6,11,11,8,8,8,8,12,10,8,7,7,11,11,8,7,9,11,10,9,8,10,12,12,12,10,7,10,6,11,7,12,11,11,12,8,12,7,9,7,8,12,11,9,6,12,8,11,7,6,9,10,12,9,11,6,9,10,9,11,12,10,11,12,9,10,9,9,12,9,7,7,6,6,8,10,12,7,7,6,12,7,9,12,6,12,7,11,10,9,8,11,11,7,6,7,11,12,7,6,8,10,7,6,7,12,6,12,10,11,7,10,7,10,11,7,12,10,10,7,9,8,12,12,8,7,7,10,10,12,8,8,12,8,9,7,12,12,7,12,7,11,6,7,7,11,12,7,8,9,9,6,10,8,12,12,10,8,12,12,12,10,9,7,11,9,9,11,8,7,8,6,6,8,10,6,8,9,8,7,10,11,7,9,11,8,7,10,8,12,7,6,6,7,7,6,7,10,7,6,7,9,6,7,11,10,12,10,12,9,7,10,9,8,9,7,11,12,9,9,8,10,10,11,12,11,12,12,11,8,7,10,7,7,11,6,6,6,10,11,11,10,8,11,12,7,9,10,6,12,8,11,6,12,12,9,9,6,10,10,7,9,12,7,10,7,12,8,10,12,11,7,8,12,9,12,12,10,10,9,11,9,7,12,7,8,12,11,8,6,12,7,9,6,11,9,6,7,10,6,6,11,7,8,9,10,7,6,6,9,6,12,11,7,9,12,6,7,10,6,7,11,10,10,8,10,12,12,6,10,12,7,11,10,9,10,10,12,8,6,12,8,10,11,10,10,10,11,6,8,9,10,7,7,12,8,9,7,11,12,6,6,12,7,11,12,9,6,10,6,10,6,9,12,12,7,6,10,8,7,9,12,9,10,12,11,11,11,12,10,10,12,7,7,6,12,10,12,7,6,10,6,12,10,9,9,7,6,11,9,12,10,6,8,6,12,12,9,11,11,7,12,6,7,9,12,11,11,8,6,12,8,8,8,10,8,12,10,8,11,6,9,9,10,12,12,11,11,6,9,6,6,6,6,7,12,6,6,12,9,9,10,10,7,9,10,9,6,9,12,11,12,8,6,9,7,8,11,7,7,9,10,6,10,12,12,10,6,9,8,7,8,8,10,6,11,6,8,7,6,6,6,12,11,11,6,8,10,10,8,7,12,12,8,12,12,6,10,6,12,9,10,7,8,10,10,12,6,6,10,9,10,10,12,8,9,7,10,8,8,11,11,10,9,9,7,11,8,12,10,8,10,11,10,11,12,11,10,7,12,12,10,12,11,6,10,7,7,12,6,8,7,6,11,9,8,7,10,7,12,12,11,9,8,12,9,9,11,7,11,10,12,12,11,12,9,8,8,7,9,7,8,11,9,7,6,12,6,6,12,6,12,11,7,9,6,11,10,9,11,8,12,10,9,10,8,10,10,10,9,9,12,9,9,8,6,9,11,9,6,12,8,9,11,12,7,7,12,8,7,9,8,12,7,9,10,10,11,9,8,11,12,7,9,9,10,7,8,12,8,6,8,8,8,6,6,10,9,6,7,8,12,11,7,11,6,11,7,10,9,12,11,7,12,11,8,10,8,12,12,9,11,6,11,7,10,7,11,12,8,8,9,10,12,7,6,8,8,12,10,6,6,12,11,7,11,8,8,10,10,6,7,7,10,12,12,9,12,10,8,6,12,10,9,7,12,11,11,7,10,12,8,11,7,8,10,8,11,6,7,12,10,7,11,8,11,7,8,9,11,7,11,11,8,12,12,6,8,8,8,7,12,9,10,9,7,12,7,6,9,8,6,11,11,9,9,7,12,8,6,8,9,11,10,8,12,12,11,8,9,9,10,10,10,10,8,8,10,10,7,8,11,9,12,10,10,8,11,11,11,12,12,8,8,12,12,11,12,8,8,6,6,8,7,9,7,9,12,10,12,9,8,12,10,6,11,12,9,7,11,10,9,12,10,9,9,6,9,9,12,7,6,8,10,6,6,6,9,7,9,12,6,7,12,11,9,8,12,6,6,7,6,10,6,11,12,12,10,7,9,7,12,8,12,8,6,8,10,11,7,12,11,9,8,11,6,9,10,6,10,11,10,8,7,8,10,7,10,7,6,8,11,12,10,9,10,7,11,7,12,12,10,6,12,11,8,8,10,11,8,6,8,6,12,7,11,9,11,6,8,10,8,6,9,12,6,9,6,7,7,8,6,11,6,11,11,9,9,7,6,11,9,7,6,10,11,7,9,6,10,11,9,10,6,9,11,10,12,12,12,11,10,10,8,7,6,10,8,11,8,12,6,11,6,10,8,9,12,6,12,12,7,11,7,8,11,6,7,7,12,6,7,9,9,9,8,7,7,11,12,6,7,6,6,12,12,6,9,10,9,8,11,12,7,10,9,9,7,12,8,12,12,10,9,6,11,10,9,8,11,10,7,11,9,7,11,7,7,12,8,12,9,6,8,12,10,8,12,9,9,12,8,11,10,8,8,11,6,11,12,11,6,10,11,10,11,7,12,12,9,6,12,9,10,6,7,9,8,11,6,12,11,7,7,12,6,10,8,8,11,12,7,9,12,6,8,12,10,8,6,8,12,9,9,8,10,11,10,10,7,10,8,8,12,7,12,10,12,8,9,12,9,12,9,6,12,12,8,6,6,10,7,9,9,8,8,11,6,12,9,8,7,9,6,8,6,7,9,12,9,12,8,11,9,11,9,8,8,7,7,7,11,10,9,11,7,9,11,7,11,7,11,9,12,7,6,10,8,11,9,8,11,6,11,9,12,12,11,9,7,7,6,6,6,9,8,8,10,6,7,9,6,6,7,11,9,7,12,6,8,10,10,11,12,11,7,7,10,6,10,9,9,6,8,10,11,9,10,11,8,11,10,9,6,11,9,12,7,8,8,8,8,9,10,6,7,6,9,7,9,12,6,11,7,9,7,9,11,7,10,8,10,10,8,12,10,10,12,7,6,11,6,7,9,8,10,10,9,11,11,12,10,8,7,9,11,9,10,7,8,12,12,12,8,6,8,8,11,11,6,7,12,10,10,7,11,10,8,8,10,7,10,11,6,12,6,8,12,11,12,6,12,8,9,10,9,9,10,12,6,11,10,7,12,6,9,12,12,11,7,7,10,8,12,11,9,6,12,8,12,12,11,11,10,9,11,11,7,6,11,10,7,7,12,9,12,6,9,10,8,6,8,7,11,12,7,9,8,6,10,6,10,8,11,10,10,8,9,9,9,10,10,7,7,9,6,12,10,12,11,10,9,7,10,7,7,11,10,9,8,7,6,11,11,6,7,10,11,11,8,8,9,6,6,12,12,7,8,12,11,7,9,9,11,11,8,6,9,8,6,9,8,11,6,12,12,7,10,8,9,8,10,8,12,7,9,11,6,6,9,6,12,8,7,10,8,10,11,8,11,12,11,9,6,7,10,11,12,9,12,6,10,8,9,6,7,11,10,11,9,10,8,12,7,9,6,10,9,10,11,12,6,8,8,8,6,12,9,10,10,8,10,8,8,10,10,12,8,8,12,9,7,10,12,6,10,7,11,6,11,10,10,11,6,12,6,9,9,11,12,8,7,10,9,8,12,10,6,9,12,7,7,9,9,6,10,8,8,11,6,9,12,10,10,12,9,12,9,11,11,11,7,11,8,9,6,8,7,12,8,8,8,10,10,6,8,10,11,6,10,8,8,11,6,11,6,7,11,9,6,11,11,11,7,8,7,6,10,6,10,10,10,11,9,12,8,8,8,6,6,7,11,12,9,12,8,9,10,7,11,9,8,7,10,8,7,7,11,9,11,11,11,7,8,10,8,7,11,10,6,10,6,8,7,9,12,7,10,11,10,6,9,10,7,6,8,12,12,9,9,11,11,11,10,11,7,6,8,9,12,8,7,11,12,7,8,11,8,10,12,9,10,8,6,12,12,8,6,12,10,6,9,11,9,11,7,12,11,8,11,7,7,11,8,10,8,6,10,10,12,12,12,8,7,8,8,12,7,8,12,8,12,6,9,10,8,6,6,11,6,11,10,6,8,10,8,7,8,7,8,9,9,9,8,11,9,8,7,10,11,9,9,11,10,7,9,11,9,11,6,10,11,9,8,12,12,8,8,6,9,8,7,9,8,10,10,11,7,9,12,7,6,12,6,10,9,11,7,7,6,12,12,12,10,7,9,6,11,11,12,7,11,11,12,9,10,7,9,11,8,7,10,7,9,9,12,10,8,10,10,9,12,10,8,8,10,11,12,7,10,8,12,11,11,8,7,11,9,9,7,10,10,6,9,10,8,7,10,9,10,11,8,7,9,12,7,12,10,11,6,7,8,10,12,8,11,11,6,12,9,7,10,6,7,7,10,9,7,12,12,6,6,7,10,9,9,8,9,8,12,10,9,8,8,9,12,10,8,9,10,12,6,7,10,8,12,10,6,11,8,8,7,6,11,6,8,10,6,6,7,10,7,9,8,8,9,11,7,10,9,6,9,10,10,7,11,11,7,11,9,12,8,8,6,10,10,7,6,9,6,8,6,11,11,8,7,9,10,6,11,11,10,8,12,9,6,10,7,11,12,11,10,11,11,9,12,6,9,9,11,9,7,7,10,12,9,9,12,12,10,12,8,11,8,11,12,12,10,6,12,8,10,7,6,9,8,7,6,8,10,6,6,7,8,6,7,7,12,8,6,7,10,10,10,8,9,12,9,10,10,6,6,10,8,10,12,7,8,12,8,8,8,9,12,8,11,8,9,7,8,6,8,12,7,6,8,9,6,6,10,9,10,8,10,10,9,7,7,9,6,6,6,10,10,12,9,7,10,11,9,11,9,6,11,9,7,8,6,12,7,11,8,6,9,6,12,12,9,6,10,10,7,12,6,12,6,12,6,9,11,9,7,10,9,10,11,9,12,10,9,12,12,11,6,12,10,6,9,6,11,8,10,7,9,6,6,6,6,11,6,11,8,10,11,9,6,9,8,8,11,10,12,10,11,11,12,12,6,12,9,11,11,9,11,9,12,8,8,12,6,12,7,7,8,9,8,12,8,8,12,6,6,6,10,12,12,12,9,7,7,8,9,11,6,10,11,8,11,11,6,10,12,10,10,11,10,8,9,11,6,9,10,7,7,10,9,7,7,10,9,11,6,7,8,8,7,11,10,12,6,7,10,7,6,11,9,8,10,6,12,10,6,7,6,12,6,9,10,8,11,9,8,6,9,11,10,10,11,6,9,11,9,6,10,12,6,7,9,9,11,7,10,8,11,9,8,12,8,6,9,7,8,7,8,10,9,7,12,12,10,11,9,9,12,6,9,6,7,12,11,6,12,6,8,9,8,12,12,9,7,6,11,7,9,12,6,12,10,6,8,6,12,10,8,9,8,10,10,9,8,6,10,11,8,7,11,11,9,10,6,6,10,11,9,8,10,10,6,9,6,9,11,7,11,7,10,7,11,10,8,8,7,12,12,12,9,11,7,9,9,9,9,8,10,12,10,7,12,6,7,10,8,9,7,6,10,9,6,12,11,6,8,12,7,7,10,11,10,11,7,8,10,6,8,7,9,9,7,12,8,8,8,11,11,12,9,12,8,6,11,6,9,7,6,7,8,7,10,7,8,8,8,11,7,10,12,7,7,6,12,7,7,9,9,8,9,12,11,11,12,7,10,11,11,7,7,7,8,12,6,8,8,6,9,6,8,11,7,12,12,9,9,9,12,11,7,11,8,7,7,9,9,12,9,11,6,7,8,6,12,12,10,10,11,11,9,10,9,12,10,12,11,12,8,9,6,7,10,9,11,11,8,7,8,11,8,10,12,12,7,12,8,12,7,9,7,10,7,12,6,9,8,10,7,11,9,7,7,8,9,12,12,8,10,9,12,12,7,12,7,6,12,6,7,10,8,8,12,6,7,6,9,6,7,10,12,10,7,6,6,11,12,11,6,10,9,10,12,12,6,11,10,10,6,9,9,6,9,7,11,6,7,10,6,8,8,10,9,10,12,10,7,8,7,6,9,12,12,6,7,12,6,10,12,11,7,11,10,7,7,11,7,12,12,7,6,7,9,7,7,11,11,10,7,6,12,7,12,8,12,7,7,11,10,9,7,12,12,11,6,6,8,10,9,6,10,8,11,7,11,11,11,9,10,7,11,11,10,9,10,6,6,7,12,11,8,10,7,9,10,6,12,10,11,11,10,7,7,12,10,7,6,11,6,7,9,9,7,8,7,12,9,7,10,11,7,7,6,9,12,10,10,10,10,11,8,11,6,8,9,8,8,11,10,7,8,7,8,9,12,6,9,8,8,6,10,10,8,6,8,9,12,9,11,9,6,12,6,11,12,12,7,7,7,11,8,11,6,8,7,8,7,8,6,11,7,7,8,8,8,10,8,12,7,11,11,12,12,12,11,7,12,9,7,11,11,8,6,10,7,9,9,12,10,11,12,12,7,8,9,7,9,11,12,12,7,12,10,11,11,10,10,11,8,9,11,11,8,10,8,7,10,10,8,7,7,11,9,9,9,11,10,11,10,8,11,9,10,11,11,12,9,8,11,11,12,9,12,7,12,12,12,11,10,9,11,7,12,9,6,10,9,6,9,8,10,11,7,9,8,9,6,12,7,11,10,6,11,7,11,8,12,9,11,11,10,9,6,8,10,12,9,6,9,12,7,7,9,12,6,10,12,7,12,11,10,11,10,12,11,6,8,7,6,10,10,12,9,10,12,10,8,11,7,9,10,10,11,10,9,8,10,10,12,8,11,11,11,8,10,10,11,10,10,6,6,9,10,9,8,9,7,7,11,9,10,9,6,11,6,11,7,6,9,9,7,6,7,11,12,8,6,7,9,10,12,10,8,7,10,10,9,6,6,10,7,7,12,12,12,8,6,10,12,11,9,9,10,10,12,7,8,6,10,8,8,6,7,12,7,12,10,11,9,9,8,7,7,11,6,9,12,10,12,7,10,12,6,10,11,11,6,11,10,8,7,12,9,10,8,8,12,8,7,6,12,10,12,9,8,9,11,10,12,6,6,10,7,6,12,12,9,6,9,6,6,11,10,7,9,10,9,6,11,12,12,12,11,7,8,11,6,12,7,7,10,9,9,6,7,10,9,10,12,9,10,7,10,9,6,9,12,8,6,9,9,8,11,6,9,9,8,6,6,12,11,12,6,7,6,8,7,12,7,12,6,9,11,8,9,9,6,8,12,10,6,10,8,9,7,10,12,8,6,6,10,6,10,11,9,9,12,6,11,6,8,10,6,10,12,6,6,11,10,10,12,10,11,7,6,12,7,7,11,10,10,11,7,8,8,12,8,10,12,12,10,10,10,6,9,12,9,11,10,9,6,6,6,7,12,9,8,7,8,12,12,12,8,11,7,10,9,12,11,10,11,6,7,8,12,7,10,6,8,7,12,8,8,9,11,6,11,6,6,10,6,7,12,8,11,10,10,10,12,6,10,7,9,6,12,6,12,6,8,12,7,7,9,8,12,8,10,11,10,12,9,8,7,8,6,12,7,6,9,9,7,9,7,11,12,10,8,7,6,11,8,7,9,9,9,10,8,12,6,11,7,6,12,10,12,9,7,11,7,12,12,8,12,11,12,6,7,9,12,12,6,8,7,12,12,11,12,8,12,12,8,7,11,6,12,6,6,6,12,12,12,7,9,10,9,9,8,9,10,12,9,8,12,7,7,12,11,10,10,8,11,7,11,7,11,11,7,12,7,12,6,12,6,11,6,9,10,8,10,7,8,6,10,10,9,11,10,7,7,10,7,8,9,12,8,12,6,9,7,12,7,9,6,7,6,9,11,6,8,10,9,12,10,7,9,6,6,7,9,11,9,8,9,7,7,12,7,12,11,6,6,8,6,10,11,6,12,6,9,10,9,8,10,10,8,6,9,12,10,9,7,11,9,9,6,11,7,6,6,7,9,8,6,9,8,11,10,10,9,6,7,9,11,8,6,6,11,10,7,12,12,11,10,12,10,11,7,6,12,7,8,11,8,8,12,12,8,10,6,10,10,9,6,12,7,7,9,11,11,6,9,6,12,11,9,8,8,9,10,10,9,11,12,12,6,6,9,6,6,11,9,11,12,11,10,7,6,12,8,9,7,9,11,7,6,6,10,11,6,8,11,8,9,11,10,9,12,9,6,8,11,11,12,10,7,6,7,8,6,8,7,12,12,7,6,7,10,7,7,11,12,6,12,6,7,11,12,9,7,9,9,11,9,9,10,7,10,8,10,12,6,8,7,10,11,12,9,6,11,11,8,12,8,7,6,7,7,10,10,7,11,6,7,8,12,6,10,12,10,9,12,12,6,6,6,6,6,11,11,10,7,10,11,6,8,7,10,8,7,12,6,12,12,8,12,7,9,12,12,7,6,8,8,11,9,6,11,12,12,8,6,10,6,7,10,6,10,10,9,12,7,10,11,6,7,6,7,6,6,7,11,7,9,6,11,11,12,6,8,12,7,12,9,9,12,10,12,10,9,11,7,7,7,11,11,6,6,7,10,10,8,7,12,6,7,11,7,8,7,10,9,10,8,11,8,8,11,10,9,8,11,8,11,8,11,8,6,8,6,11,8,6,7,6,10,7,6,9,10,8,10,11,7,9,12,11,7,6,6,10,10,6,8,6,12,7,8,6,7,9,12,10,7,9,12,6,7,7,9,9,12,7,10,7,9,12,8,9,11,8,6,7,11,8,11,10,12,7,6,10,6,12,7,12,12,6,12,10,6,11,7,7,11,11,6,7,7,8,7,6,9,7,8,9,11,9,9,11,7,11,8,9,7,9,8,11,10,11,8,8,6,9,12,6,11,12,10,9,10,12,12,11,6,11,6,6,8,9,12,7,8,10,10,9,11,12,11,6,7,8,6,10,6,9,12,9,7,6,7,7,7,9,6,6,11,7,9,9,6,11,12,6,10,12,7,9,11,12,8,12,11,12,8,7,10,11,11,12,6,10,11,9,10,6,6,7,11,6,9,10,10,10,12,8,11,11,10,12,9,7,9,11,6,6,8,9,8,9,6,7,8,7,6,8,11,11,11,7,6,9,6,12,9,7,12,8,10,10,12,11,7,10,9,11,11,6,10,8,12,11,7,11,12,8,6,12,8,11,6,7,11,6,7,12,9,10,10,10,9,11,8,9,12,12,9,9,10,8,6,7,11,10,9,7,8,8,8,6,12,9,9,7,10,7,10,6,11,9,11,9,11,7,7,6,8,8,9,11,9,10,8,8,6,9,12,10,9,9,8,7,10,6,7,6,9,9,6,11,7,12,11,6,7,6,6,10,9,11,12,8,9,9,8,10,9,7,12,10,8,12,8,6,12,9,8,8,9,10,6,6,7,12,7,12,12,11,11,12,12,6,12,11,8,6,12,9,12,12,10,7,12,7,6,11,8,9,8,8,12,8,9,11,10,9,11,9,8,8,8,6,12,7,7,10,12,6,12,8,7,11,12,10,10,8,8,6,7,6,7,9,6,8,9,9,7,7,12,8,11,11,12,8,6,8,9,8,8,10,8,12,8,6,8,10,8,6,8,11,6], // 10000
];

include_once dirname(__DIR__) . DIRECTORY_SEPARATOR ."xhprof.php";
$xhprof = new Xhprof();
foreach ($datas as $data){
    // var_dump($data);

    $obj = new Solution();
    $result = $obj->longestWPI($data);
    var_dump($result);
    echo str_repeat("<br>", 3);
}
$xhprof->end();
